namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class _20200224001 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.xiangguangongzuos",
                c => new
                    {
                        xggzid = c.Int(nullable: false, identity: true),
                        xggz = c.Int(nullable: false),
                        MyKaoHeBiao_two_twoid = c.Int(),
                    })
                .PrimaryKey(t => t.xggzid)
                .ForeignKey("dbo.MyKaoHeBiao_two", t => t.MyKaoHeBiao_two_twoid)
                .Index(t => t.MyKaoHeBiao_two_twoid);
            
            CreateTable(
                "dbo.zongjieones",
                c => new
                    {
                        zjid = c.Int(nullable: false, identity: true),
                        zjmc = c.String(),
                    })
                .PrimaryKey(t => t.zjid);
            
            CreateTable(
                "dbo.zongjietwoes",
                c => new
                    {
                        zjtowid = c.Int(nullable: false, identity: true),
                        zongjielx = c.Int(nullable: false),
                        zongjielxstr = c.String(),
                        zongjienr = c.String(),
                        zongjieone_zjid = c.Int(),
                    })
                .PrimaryKey(t => t.zjtowid)
                .ForeignKey("dbo.zongjieones", t => t.zongjieone_zjid)
                .Index(t => t.zongjieone_zjid);
            
            AddColumn("dbo.MyKaoHeBiaos", "MyKaoHeZongJie_zjid", c => c.Int());
            AddColumn("dbo.MyKaoHeBiao_two", "gzcdrid", c => c.Guid(nullable: false));
            AddColumn("dbo.MyKaoHeBiao_two", "gzcdr", c => c.String());
            AddColumn("dbo.MyKaoHeBiao_two", "zycd", c => c.Int(nullable: false));
            CreateIndex("dbo.MyKaoHeBiaos", "MyKaoHeZongJie_zjid");
            AddForeignKey("dbo.MyKaoHeBiaos", "MyKaoHeZongJie_zjid", "dbo.zongjieones", "zjid");
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.MyKaoHeBiaos", "MyKaoHeZongJie_zjid", "dbo.zongjieones");
            DropForeignKey("dbo.zongjietwoes", "zongjieone_zjid", "dbo.zongjieones");
            DropForeignKey("dbo.xiangguangongzuos", "MyKaoHeBiao_two_twoid", "dbo.MyKaoHeBiao_two");
            DropIndex("dbo.zongjietwoes", new[] { "zongjieone_zjid" });
            DropIndex("dbo.xiangguangongzuos", new[] { "MyKaoHeBiao_two_twoid" });
            DropIndex("dbo.MyKaoHeBiaos", new[] { "MyKaoHeZongJie_zjid" });
            DropColumn("dbo.MyKaoHeBiao_two", "zycd");
            DropColumn("dbo.MyKaoHeBiao_two", "gzcdr");
            DropColumn("dbo.MyKaoHeBiao_two", "gzcdrid");
            DropColumn("dbo.MyKaoHeBiaos", "MyKaoHeZongJie_zjid");
            DropTable("dbo.zongjietwoes");
            DropTable("dbo.zongjieones");
            DropTable("dbo.xiangguangongzuos");
        }
    }
}
